.cp__header {
  @apply shadow z-10;
  -webkit-app-region: drag;

  padding-top: calc(var(--ls-headbar-inner-top-padding));
  margin-top: var(--ls-win32-title-bar-height);
  height: calc(var(--ls-headbar-height) + var(--ls-headbar-inner-top-padding));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  line-height: 1;
  white-space: nowrap;

  > .l {
    @apply pl-2;

    min-width: var(--ls-left-sidebar-width);
    height: 100%;
    align-items: center;
    transition: padding-left .2s;
  }

  > .r {
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    padding-right: 6px;
  }

  /* To prevent header glitch on Safari */

  > .l, > .r {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  .button {
    display: flex;
    align-items: center;
    justify-content: center;

    .ti, .tie {
      font-size: 20px;
    }
  }

  .ui-items-container .button {
    width: auto;
    padding: 0 8px;
  }

  svg.warning {
    transform: scale(0.6);
    color: red;
  }

  &-tips {
    position: absolute;
    padding: 13px 0;
    text-align: center;
    font-weight: 500;
    background: transparent;
    margin-top: 0;
    line-height: 0;
    top: 0;
    left: 40%;
    transform: translateX(-50%);
    z-index: 1000;

    > p {
      color: var(--ls-primary-text-color);
      margin: 0;
      display: inline-flex;
      align-items: center;
      font-size: 14px;
    }

    a {
      color: var(--ls-link-text-color, #045591) !important;
    }

    a.restart {
      position: relative;
      display: flex;
      align-items: center;

      svg {
        color: currentColor !important;
        margin-right: 2px;
      }

      > strong {
        display: inline-block;
        padding-left: 2px;
        cursor: pointer;
      }
    }
  }

  .dropdown-wrapper {
    .ti, .tie {
      opacity: .9;
    }
  }

  .add-graph-btn {
    border: 1px dashed var(--ls-border-color);
    padding: 0 8px;

    strong {
      padding: 0 10px;
      position: relative;
      top: 1px;
    }
  }
}

.is-electron.is-mac .cp__header {
  > .l {
    padding-left: 78px;
  }
}

.is-electron.is-mac.is-fullscreen .cp__header > .l {
  padding-left: 1rem;
}

/* Workaround for Linux Intel GPU text rendering issue GH#7233 */
.is-electron.is-linux .cp__header .dropdown-wrapper .title-wrap {
  position: relative;
}

.cp__header a,
.cp__header svg,
.cp__header button {
  -webkit-app-region: no-drag;
}

.cp__header-logo {
  @apply p-2;
}

.cp__header-logo {
  display: none;
}

.cp__header-logo:hover {
  opacity: 1;
}

.cp__header-logo-img {
  width: 24px;
  height: 24px;
}

@screen sm {
  .cp__header {
    @apply shadow-none;
  }

  .cp__header-logo {
    display: block;
  }
}

.cp__header-logo svg {
  transform: scale(0.9);
}

#repo-name {
  @apply inline-flex items-center whitespace-nowrap;
  max-width: 16ch;
}

.button {
  @apply h-8 px-2.5 py-1 rounded-md opacity-90 block select-none hover:opacity-100 active:opacity-80;

  &:hover {
    @screen md {
      background: var(--lx-gray-04, var(--ls-tertiary-background-color, var(--rx-gray-04)));
    }
  }
}

.button.icon {
  @apply w-8 h-8 p-1 flex items-center justify-center;
}

.button.icon.add-graph-btn {
    width: unset;
    margin: 0 6px;
}

.is-mac.is-electron :is(.cp__header, .cp__right-sidebar-topbar) :is(button, .button, a):not(.file-sync-item) {
  cursor: default !important;
}

html.is-ios.is-safari {

  .cp__header {
    background-color: var(--ls-primary-background-color);
  }

  .is-vw-pending {
    display: none !important;
  }
}

html.is-native-iphone,
html.is-native-iphone-without-notch,
html.is-native-ipad {

  #main-container {
    padding-top: 0;
    display: flex;
    flex-direction: column;
  }

  #main-content-container {
    padding-left: 22px;
    padding-right: 14px;
    padding-top: 0;
    height: calc(100vh - var(--ls-headbar-inner-top-padding) - var(--ls-headbar-height));

    @screen sm {
      padding-left: 2rem;
    }

    .page {
      margin-top: 15px;
    }
  }

  .cp__header {
    > .r {
      display: flex;
    }

    .button {
      opacity: 1;
    }
  }
}

html.is-native-ipad {
  --ls-headbar-inner-top-padding: 0px;
  --ls-headbar-height: 4rem;

  .cp__header {
    background-color: transparent !important;
    display: flex;

    > .l {
      /* background-color: var(--ls-primary-background-color); */
      padding-top: 20px;
    }

    > .r {
      flex: 1;
      background-color: var(--ls-primary-background-color);
      height: 100%;
      padding-top: 20px;
      justify-content: flex-end;
      align-items: center;
    }
  }

  .left-sidebar-inner  {
    > .wrap {
      padding-top: 20px;
    }
  }

  .cp__right-sidebar {
    &-settings {
      margin-top: -4px;
    }

    &-topbar {
      padding-top: 37px;
    }

    &-inner {
      .resizer {
        top: 30vh;
        width: 12px;
        height: 40vh;
      }

      .resizer:hover {
        background-color: var(--ls-guideline-color, #ddd);
      }
    }
  }
}

html.is-native-iphone {
  --ls-headbar-inner-top-padding: 38px;

  .left-sidebar-inner {
    .create {
      padding-bottom: 32px;
    }
  }

  .ui__notifications {
    top: calc(var(--ls-headbar-height) + var(--ls-headbar-inner-top-padding) - 0.3rem);
  }

  @media (orientation: landscape) {
    --ls-headbar-inner-top-padding: 8px;
    --ls-headbar-height: 2.5rem;
  }
}

html.is-native-iphone-without-notch {

  --ls-headbar-inner-top-padding: 15px;
  --ls-headbar-height: 2.5rem;

  @media (orientation: landscape) {

    --ls-headbar-inner-top-padding: 0px;
    --ls-headbar-height: 2.5rem;
  }
}

html.is-zoomed-native-ios {
  --ls-headbar-inner-top-padding: 30px;

  @media (orientation: landscape) {
    --ls-headbar-inner-top-padding: 8px;
    --ls-headbar-height: 2.5rem;
  }
}

.drag-region {
  user-select: none;
  -webkit-app-region: drag;
}
